﻿using System;
using System.Collections.Generic;
using System.Linq;
using EncuentraloSilverlight.Models;


namespace EncuentraloSilverlight.Web.Models
{
    public partial class Seller
    {
        public bool IsValid
        {
            get { return (GetSellerRuleViolations().Count() == 0 ); }
        }

        public IEnumerable<RuleViolation> GetSellerRuleViolations() 
        {

            if (String.IsNullOrEmpty(Name))
                yield return new RuleViolation("Username required", "UserName");
            if (String.IsNullOrEmpty(Password))
                yield return new RuleViolation("Username required","Password ");
           

            yield break;
    
        }

    }
}